//app.js
App({
  globalData: {
    code: null,
    shopid: 'M_029_001'
  },
  onLaunch: function () {
    wx.getSystemInfo({
      success: function (res) {
        if (res.model.search('iPhone X') != -1) { 
          wx.setStorageSync('ipx', 1); 
        } else {
          wx.setStorageSync('ipx', 0); 
        }
      }
    })
    const that = this
    wx.login({
      success(res) {
        if (res.code) that.globalData.code = res.code
      }
    })
      
  }
})